<template>
  <div class="p16">
    <h3 class="title">基本信息</h3>
    <table class="table_ mb24">
        <tr>
            <td class="key_name">人员名称</td>
            <td class="fb key_value">{{info.employee.name}}</td>
            <td class="">职工号</td>
            <td class="fb">{{info.employee.code}}</td>
            <td rowspan="6" class="tx-c" style="width:200px">
                <el-image class="logo_img" :src="info.image">
                    <div slot="error" class="image-slot">
                        <img src="@/assets/img/headerPhoto.png" alt="">
                    </div>
                </el-image>
            </td>
        </tr>
        <tr>
            <td class="key_name">所属科室</td>
            <td class="fb key_value">{{info.department?info.department.name:''}}</td>
            
            <td class="">系统角色</td>
            <td class="fb">{{info.role ? info.role.name : '暂无系统角色'}}</td>
        </tr>
        <tr>
            <td class="">性别</td>
            <td class="fb">{{info.gander?info.gander === 1?'男':'女':''}}</td>
            <td class="">专业职称</td>
            <td class="fb">{{info.professional_rank_title}}</td>
        </tr>
        <tr>
            <td class="">职称级别</td>
            <td class="fb">{{echo(info.professional_rank_level,professionalRankLevel)}}</td>
            <td class="">最高学位</td>
            <td class="fb">{{echo(info.first_education,firstEducation)}}</td>
        </tr>
        <tr>
            <td class="">手机</td>
            <td class="fb">{{info.phone}}</td>
            <td class="">身份证号</td>
            <td class="fb">{{info.card_no}}</td>
        </tr>
        <tr>
            <td class="">出生日期</td>
            <td class="fb">{{info.birth}}</td>
            <td class=""></td>
            <td class="fb"></td>
        </tr>
    </table>
  </div>
</template>

<script>
import {firstEducation,professionalRankLevel} from '@/assets/js'

export default {
    props:{
        info:{
            default: ()=>({department: {},employee: {}}),
            type:Object,
        }
    },
    data(){
        return{
            firstEducation,
            professionalRankLevel
        }
    },
    methods:{
        echo(i,arr){
            let label
            for (const item of arr) {
                if(item.value === i){
                label = item.label
                break;
                }
            }
            return label
        },
    }
}
</script>
